//
//  FileServiceManager.h
//  Common
//
//  Created by guoshiqing on 2018/5/31.
//

#import <Foundation/Foundation.h>
#import "Macro.h"

#define FM [FileManager shared]

typedef void(^SaveFileSuccessBlock)(NSString *filePath);

@interface FileManager : NSObject

@property (nonatomic, copy) SaveFileSuccessBlock saveFileSuccess;
#pragma 注册返回
- (void)registerSaveSuccessBlock:(SaveFileSuccessBlock)saveFileSuccessBlock;

+ (instancetype)shared;

// 缓存路径
- (NSString *)moduleCachePath;
- (NSString *)baseCachePath;

// 初始化目录
+ (void)prepareFileManagerDirForrAppModule:(EPModuleType)type;

// 清理缓存
+ (void)clearCacheInFileManagerForAppModule:(EPModuleType)type;

// 文件存储目录
+ (NSString *)getFileRootPathForAppModule:(EPModuleType)type;

// 保存临时图片
+ (NSString *)saveCacheImage:(UIImage *)image fileName:(NSString *)fileName forAppModuleType:(EPModuleType)type;

// 保存临时图片到云盘
+ (NSString *)saveCacheImageToCloudDisk:(UIImage *)image fileName:(NSString *)fileName teamId:(NSString *)teamId;

// 保存临时视频到云盘
+ (void)saveCacheVideoToCloudDisk:(NSURL *)videoUrl fileName:(NSString *)fileName teamId:(NSString *)teamId;

// 根据团队获取云盘下载目录
+ (NSString *)cloudStoragePathAboutDownLoadWithTeamId:(NSString *)TeamId;

// 清理云盘上传文件
+ (void)clearCloudStoragePathAboutUpLoadingWithTeamId:(NSString *)TeamId;

// 清理云盘下载文件
+ (void)clearCloudStoragePathAboutDownLoadWithTeamId:(NSString *)TeamId;

// 查找云盘下载文件中是否已有该文件
+ (NSString *)searchCloudStoragePathAboutDownLoadWithTeamId:(NSString *)TeamId andFileName:(NSString *)FileName;


@end
